load("@rules_zig//zig:defs.bzl", "zig_library")
load("//bazel:swig.bzl", "swig_cc_library")
load("//bazel:zig_srcs.bzl", "zig_srcs")

swig_cc_library(
    name = "sentencepiece_swig",
    interface = "sentencepiece.i",
    module = "sentencepiece",
    deps = [
        "//ffi:cc",
        "@com_google_sentencepiece//:sentencepiece_processor",
    ],
)

zig_library(
    name = "sentencepiece",
    import_name = "sentencepiece",
    main = "sentencepiece.zig",
    visibility = ["//visibility:public"],
    deps = [
        ":sentencepiece_swig",
        "//ffi:zig",
        "//stdx",
    ],
)

zig_srcs(
    name = "sources",
    zig_lib = ":sentencepiece",
)

cc_static_library(
    name="sentencepiece_static",
    deps = [":sentencepiece_swig"]
)
